<?php 
/**********************************************************
 *	Label the letters requested by the user
 *	Seal Created by 2010-1-3
 **********************************************************/

	if( !isset($_POST['ids']) || !isset($_POST['label']) )
	{
		echo "没有指定任何要标记的邮件或者没有标记！";
		edp_exit();
	}
	
	$label = trim( $_POST['label'] );
	if( $label != '0' && $label != '1' )
	{
		echo "标记错误！";
		edp_exit();
	}
	
	
	$ids = $_POST['ids'];
	$idarray = split( ',', $ids );
	$ids = '';
	
	foreach( $idarray as $key => $value )
	{
		if( is_numeric($value) )
		{
			$ids .= $value;
			$ids .= ',';
		}
	}
	
	$ids = trim( $ids, " ," );
	
	if( edp_is_empty_string($ids) )
	{
		echo "没有指定任何要标记的邮件！";
		edp_exit();
	}
	
	$uid = GetLoginUserID();
	if($uid===false)
	{
		echo "非法的站内信操作";
		edp_exit();
	}
	else 
	{
		$letterDAO = GetLetterDAO();
		$letterDAO->LabelRead( $label, $ids, $uid );
				
		echo "标记成功！";
	}
?>